<?php
namespace Home\Controller;
use Think\Controller;
class AdminController extends Controller{
	public function login(){
		$this->display();
	}

	public function index(){
		$this->display();
	}

	public function clubArrange(){
		$this->display();
	}


    public function coachArrange(){

        $coachmodel=M('coaches');
          // var_dump($coachmodel);
            $this->coach=$coachmodel->select();
      //调用视图层显示结果
          $this->display();

  }
	public function checkLogin(){
     $usermodel=M('admin');
     $data['admin']=trim(I('post.admin'));
     $data['password']=md5(I('post.password'));
     $rs=$usermodel->where($data)->select();
     if($rs){
      session("admin",$data['admin']);
      $this->success('登陆成功',U('index'));
      }
      else{
        $this->error("账号或密码错误");
       } 
      }
}
?>